package gcontent.Results;

import java.util.ArrayList;

public class Results {
	private ArrayList<Result> results = new ArrayList<Result>();
	
	public void add(Result result_str) {
		results.add(result_str);
	}
	
	public int getCount() {
		return results.size();
	}
	
	public void parseResults(int first, int last, Results from) {		
		for (int i = 0; i < from.getCount(); i++) {
			if (i < last && i >= first)
				from.getAt(i).setVisible(true);
			else
				from.getAt(i).setVisible(false);
		}				
	}
	
	public Result getAt(int index) {
		try {
			return results.get(index);
		} catch (IndexOutOfBoundsException ex) {
			ex.printStackTrace();
			return null;
		}
	}
}
